home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / lisp / ilisp / ilisp-doc.el.z / ilisp-doc.el
Encoding:
Text File  |  1998-05-21  |  20.7 KB  |  431 lines

  1. ;;; -*- Mode: Emacs-Lisp -*-
  2.  
  3. ;;; ilisp-doc.el --
  4.  
  5. ;;; This file is part of ILISP.
  6. ;;; Version: 5.8
  7. ;;;
  8. ;;; Copyright (C) 1990, 1991, 1992, 1993 Chris McConnell
  9. ;;;               1993, 1994 Ivan Vasquez
  10. ;;;               1994, 1995, 1996 Marco Antoniotti and Rick Busdiecker
  11. ;;;               1996 Marco Antoniotti and Rick Campbell
  12. ;;;
  13. ;;; Other authors' names for which this Copyright notice also holds
  14. ;;; may appear later in this file.
  15. ;;;
  16. ;;; Send mail to 'ilisp-request@naggum.no' to be included in the
  17. ;;; ILISP mailing list. 'ilisp@naggum.no' is the general ILISP
  18. ;;; mailing list were bugs and improvements are discussed.
  19. ;;;
  20. ;;; ILISP is freely redistributable under the terms found in the file
  21. ;;; COPYING.
  22.  
  23.  
  24. ;;;
  25. ;;; ILISP mode documentation
  26. ;;;
  27.  
  28. (defconst ilisp-documentation
  29.   "Major mode for interacting with an inferior LISP process.  Runs a
  30. LISP interpreter as a subprocess of Emacs, with LISP I/O through an
  31. Emacs buffer.  If you have problems, use M-x ilisp-bug in the buffer
  32. where you are having a problem to send a bug report.
  33.  
  34. To start a LISP use M-x run-ilisp, or a specific dialect like M-x
  35. allegro.  If called with a prefix you will be prompted for a buffer
  36. name and a program to run.  The default buffer name is the name of the
  37. dialect.  The default program for a dialect will be the value of
  38. DIALECT-program or the value of ilisp-program inherited from a less
  39. specific dialect.  If there are multiple LISP's, use the dialect name
  40. or select-ilisp \(\\[select-ilisp]) to select the current ILISP
  41. buffer.
  42.  
  43. Currently supported LISP dialects include:
  44.  clisp
  45.    allegro
  46.    lucid
  47.    kcl
  48.      akcl
  49.        gcl
  50.        ecl
  51.      ibcl
  52.    cmulisp
  53.    clisp-hs
  54.    lispworks
  55.  scheme
  56.    oaklisp
  57.  
  58. Customization: Starting a dialect runs the hooks on comint-mode-hook
  59. and ilisp-mode-hook and then DIALECT-hooks specific to dialects in the
  60. nesting order above.  On the very first prompt in the inferior LISP,
  61. the hooks on ilisp-init-hook are run.  For more information on
  62. creating a new dialect or variables to set in hooks, see ilisp.el.
  63.  
  64. Most of these key bindings work in both Lisp Mode and ILISP mode.
  65. There are a few additional and-go bindings found in Lisp Mode.
  66. \\{ilisp-use-map}
  67. There are also a few bindings found in global-map including:
  68.   \\[ilisp-bury-output] ilisp-bury-output
  69.   \\[ilisp-scroll-output] ilisp-scroll-output
  70.   \\[previous-buffer-lisp] previous-buffer-lisp
  71.   \\[switch-to-lisp] switch-to-lisp
  72.  
  73. ILISP has a very flexible means for displaying output from the underlying lisp.
  74. All output is funneled through the function bound to ilisp-display-output-function.
  75. That function gets a single argument, the string to display, and should make it
  76. visible to the user.  The default display function, ilisp-display-output-default,
  77. displays one-line output in the echo area and longer output in a shrink-wrapped 
  78. typeout window.  This typeout window can be manipulated with \\[ilisp-bury-output]
  79. ilisp-bury-output, \\[ilisp-scroll-output] ilisp-scroll-output, and \\[ilisp-grow-output] 
  80. ilisp-grow-output.
  81.  
  82. An alternative to typeout windows is to always have the inferior LISP
  83. buffer visible and have all output go there.  If your are using the default
  84. display function, then setting lisp-no-popper to T will cause all output to go 
  85. to the inferior LISP buffer.  Setting comint-always-scroll to T will cause 
  86. process output to always be visible.  If a command gets an error, you will be 
  87. left in the break loop.
  88.  
  89. Here are the supplied display functions:
  90.  ilisp-display-output-default
  91.  ilisp-display-output-adaptively
  92.  ilisp-display-output-in-echo-area
  93.  ilisp-display-output-in-typeout-window
  94.  ilisp-display-output-in-lisp-listener
  95.  
  96. Each ILISP buffer has a command history associated with it.  Commands
  97. that do not match ilisp-filter-regexp and that are longer than
  98. ilisp-filter-length and that do not match the immediately prior
  99. command will be added to this history.  comint-previous-input
  100. \(\\[comint-previous-input]) and comint-next-input
  101. \(\\[comint-next-input]) cycle through the input history.
  102. comint-previous-similar-input \(\\[comint-previous-similar-input])
  103. cycles through input that has the string typed so far as a prefix.
  104.  
  105. See comint-mode documentation for more information on comint commands.
  106.  
  107. A number of commands refer to \"defun\".  A \"defun\" is a list that
  108. starts at the left margin in a LISP buffer, or after a prompt in the
  109. ILISP buffer.  So the commands refer to the \"defun\" that contains
  110. point.
  111.  
  112. There are two keyboard modes for interacting with the inferior LISP,
  113. \"interactive\" and \"raw\".  Normally you are in interactive mode
  114. where keys are interpreted as commands to EMACS and nothing is sent to
  115. the inferior LISP unless a specific command does so.  In raw mode, all
  116. characters are passed directly to the inferior LISP without any
  117. interpretation as EMACS commands.  Keys will not be echoed unless
  118. ilisp-raw-echo is T.  Raw mode can be turned on interactively by
  119. raw-keys-ilisp \(\\[raw-keys-ilisp]) and will continue until you type
  120. C-g.  Raw mode can also be turned on/off by inferior LISP functions if
  121. io-bridge-ilisp \(\\[io-bridge-ilisp]) has been executed in the
  122. inferior LISP interactively or on a hook.  To turn on raw mode, a
  123. function should print ^[1^] and to turn it off should print ^[0^].
  124.  
  125. When you send something to LISP, the status light will reflect the
  126. progress of the command.  If you type top-level forms ahead of the
  127. processing, the status may indicate ready when the LISP is actually
  128. running.  In a lisp mode buffer the light will reflect the status of
  129. the currently selected inferior LISP unless lisp-show-status is nil.
  130. If you want to find out what command is currently running, use the
  131. command status-lisp \(\\[status-lisp]).  If you call it with a prefix,
  132. the pending commands will be displayed as well.
  133.  
  134. If you are want to abort the last command you can use
  135. \(\\[keyboard-quit]).  If you want to abort all commands, you should
  136. use the command abort-commands-lisp \(\\[abort-commands-lisp]).
  137. Commands that are aborted will be put in the buffer *Aborted Commands*
  138. so that you can see what was aborted.  If you want to abort the
  139. currently running top-level command, use interrupt-subjob-ilisp
  140. \(\\[interrupt-subjob-ilisp]).  As a last resort, \\[panic-lisp] will
  141. reset the ILISP state without affecting the inferior LISP so that you
  142. can see what is happening.  If you become totally frustrated, you can
  143. also try \\[repair-ilisp].
  144.  
  145. bol-ilisp \(\\[bol-ilisp]) will go after the prompt as defined by
  146. comint-prompt-regexp or ilisp-other-prompt or to the left margin with
  147. a prefix.
  148.  
  149. return-ilisp \(\\[return-ilisp]) knows about prompts and sexps.  If an
  150. sexp is not complete, it will indent properly.  When an entire sexp is
  151. complete, it is sent to the inferior LISP together with a new line.
  152. If you edit old input, the input will be copied to the end of the
  153. buffer first.
  154.  
  155. close-and-send-lisp \(\\[close-and-send-lisp]) will close the current
  156. sexp, indent it, then send it to the current inferior LISP.
  157.  
  158. indent-line-ilisp \(\\[indent-line-ilisp]) indents for LISP.  With
  159. prefix, shifts rest of expression rigidly with the current line.
  160.  
  161. newline-and-indent-lisp \(\\[newline-and-indent-lisp]) will insert a
  162. new line and then indent to the appropriate level.  If you are at the
  163. end of the inferior LISP buffer and an sexp, the sexp will be sent to
  164. the inferior LISP without a trailing newline.
  165.  
  166. indent-sexp-ilisp \(\\[indent-sexp-ilisp]) will indent each line in
  167. the next sexp.
  168.  
  169. backward-delete-char-untabify \(\\[backward-delete-char-untabify])
  170. converts tabs to spaces as it moves back.
  171.  
  172. delete-char-or-pop-ilisp \(\\[delete-char-or-pop-ilisp]) will delete
  173. prefix characters unless you are at the end of an ILISP buffer in
  174. which case it will pop one level in the break loop.
  175.  
  176. reset-ilisp, \(\\[reset-ilisp]) will reset the current inferior LISP's
  177. top-level so that it will no longer be in a break loop.
  178.  
  179. switch-to-lisp \(\\[switch-to-lisp]) will pop to the current ILISP
  180. buffer or if already in an ILISP buffer, it will return to the buffer
  181. that last switched to an ILISP buffer.  With a prefix, it will also go
  182. to the end of the buffer.  If you do not want it to pop, set
  183. pop-up-windows to nil.  
  184.  
  185. call-defun-lisp \(\\[call-defun-lisp]) will put a call to the current
  186. defun in the inferior LISP and go there.  If it is a \(def* name form,
  187. it looks up reasonable forms of name in the input history unless
  188. called with a prefix. If not found, \(name or *name* will be inserted.
  189. If it is not a def* form, the whole defun will be put in the buffer.
  190.  
  191. reposition-window-lisp \(\\[reposition-window-lisp]) will scroll the
  192. current window to show as much of the current defun and its
  193. introductory comments as possible without moving the point.  If called
  194. with a prefix, the point will be moved if necessary to show the start
  195. of the defun.  If called more than once with the first line of the
  196. defun showing, the introductory comments will be shown or suppressed.
  197.  
  198. previous-buffer-lisp \(\\[previous-buffer-lisp]) will switch to the
  199. last visited buffer in the current window or the Nth previous buffer
  200. with a prefix.
  201.  
  202. find-unbalanced-lisp \(\\[find-unbalanced-lisp]) will find unbalanced
  203. parens in the current buffer.  When called with a prefix it will look
  204. in the current region.
  205.  
  206. close-all-lisp \(\\[close-all-lisp]) will close all outstanding
  207. parens back to the containing form, or a previous left bracket
  208. which will be converted to a left parens.  If there are too many
  209. parens, they will be deleted unless there is text between the
  210. last paren and the end of the defun.  If called with a prefix,
  211. all open left brackets will be closed.
  212.  
  213. reindent-lisp \(\\[reindent-lisp]) will reindent the current paragraph
  214. if in a comment or string.  Otherwise it will close the containing
  215. defun and reindent it.
  216.  
  217. comment-region-lisp \(\\[comment-region-lisp]) will put prefix copies of
  218. comment-start before and comment-end's after the lines in region.  To
  219. uncomment a region, use a minus prefix.
  220.  
  221. The very first inferior LISP command executed may send some forms to
  222. initialize the inferior LISP.
  223.  
  224. Each time an inferior LISP command is executed, the last form sent can be
  225. seen in the \*ilisp-send* buffer.
  226.  
  227. The first time an inferior LISP mode command is executed in a Lisp
  228. Mode buffer, the package will be determined by using the regular
  229. expression ilisp-package-regexp to find a package sexp and then
  230. passing that sexp to the inferior LISP through ilisp-package-command.
  231. For the clisp dialect, this will find the first \(in-package PACKAGE)
  232. form in the file.  A buffer's package will be displayed in the mode
  233. line.  set-buffer-package-lisp \(\\[set-buffer-package-lisp]) will
  234. update the current package from the buffer.  If it is called with a
  235. prefix, the package can be set manually.  If a buffer has no
  236. specification, forms will be evaluated in the current inferior LISP
  237. package.  package-lisp \(\\[package-lisp]) will show the current
  238. package of the inferior LISP.  set-package-lisp
  239. \(\\[set-package-lisp]) will set the inferior LISP package to the
  240. current buffer's package or to a manually entered package with a
  241. prefix.
  242.  
  243. describe-lisp, inspect-lisp, arglist-lisp, documentation-lisp,
  244. macroexpand-1-lisp, macroexpand-lisp, edit-definitions-lisp,
  245. who-calls-lisp, edit-callers-lisp and trace-defun-lisp will switch
  246. whether they prompt for a response or use a default when called with a
  247. negative prefix.  If they are prompting, there is completion through
  248. the inferior LISP by using TAB or M-TAB.  When you are entering an
  249. expression in the minibuffer, all of the normal ilisp commands like
  250. arglist-lisp also work.
  251.  
  252. Commands that work on a function will use the nearest previous
  253. function symbol.  This is either a symbol after a #' or the symbol at
  254. the start of the current list.
  255.  
  256. describe-lisp \(\\[describe-lisp]) will describe the previous sexp.
  257. inspect-lisp \(\\[inpsect-lisp]) will inspect the previous sexp.If
  258. there is no previous-sexp and you are in an ILISP buffer, the previous
  259. result will be described or inspected.
  260.  
  261. arglist-lisp \(\\[arglist-lisp]) will return the arglist of the
  262. current function.  With a numeric prefix, the leading paren will be
  263. removed and the arglist will be inserted into the buffer.
  264.  
  265. documentation-lisp \(\\[documentation-lisp]) infers whether function
  266. or variable documentation is desired.  With a negative prefix, you can
  267. specify the type of documentation as well.  With a positive prefix the
  268. documentation of the current function call is returned.
  269.  
  270. If the Franz online Common LISP manual is available, fi:clman
  271. \(\\[fi:clman]) will get information on a specific symbol.
  272. fi:clman-apropos \(\\[fi:clman-apropos]) will get information apropos
  273. a specific string.  Some of the documentation is specific to the
  274. allegro dialect, but most of it is for standard Common LISP.
  275.  
  276. macroexpand-lisp \(\\[macroexpand-lisp]) and macroexpand-1-lisp
  277. \(\\[macroexpand-1-lisp]) will be applied to the next sexp.  They will
  278. insert their result into the buffer if called with a numeric prefix.
  279.  
  280. complete-lisp \(\\[complete-lisp]) will try to complete the previous
  281. symbol in the current inferior LISP.  Partial completion is supported
  282. unless ilisp-prefix-match is set to T.  \(If you set it to T, inferior
  283. LISP completions will be faster.)  With partial completion, \"p--n\"
  284. would complete to \"position-if-not\" in Common LISP.  If the symbol
  285. follows a left paren or a #', only symbols with function cells will be
  286. considered.  If the symbol starts with a \* or you call with a
  287. positive prefix all possible completions will be considered.  Only
  288. external symbols are considered if there is a package qualification
  289. with only one colon.  The first time you try to complete a string the
  290. longest common substring will be inserted and the cursor will be left
  291. on the point of ambiguity.  If you try to complete again, you can see
  292. the possible completions.  If you are in a string, then filename
  293. completion will be done instead.  And if you try to complete a
  294. filename twice, you will see a list of possible completions.  Filename
  295. components are completed individually, so /u/mi/ could expand to
  296. /usr/misc/.  If you complete with a negative prefix, the most recent
  297. completion \(symbol or filename) will be undone.
  298.  
  299. complete \(\\[complete]) will complete the current symbol to the most
  300. recently seen symbol in Emacs that matches what you have typed so far.
  301. Executing it repeatedly will cycle through potential matches.  This is
  302. from the TMC completion package and there may be some delay as it is
  303. initially loaded.
  304.  
  305. trace-defun-lisp \(\\[trace-defun-lisp]) traces the current defun.
  306. When called with a numeric prefix the function will be untraced.
  307.  
  308. trace-defun-lisp-break \(\\[trace-defun-lisp-break]) traces the
  309. current defun but sets a breakpoint in the function if possible.
  310. When called with a numeric prefix the function will be untraced.
  311.  
  312. default-directory-lisp \(\\[default-directory-lisp]\) sets the default
  313. inferior LISP directory to the directory of the current buffer.  If
  314. called in an inferior LISP buffer, it sets the Emacs default-directory
  315. the LISP default directory.
  316.  
  317. The eval/compile commands evaluate or compile the forms specified.  If
  318. any of the forms contain an interactive command, then the command will
  319. never return.  To get out of this state, you need to use
  320. abort-commands-lisp \(\\[abort-commands-lisp]).  The eval/compile
  321. commands verify that their expressions are balanced and then send the
  322. form to the inferior LISP.  If called with a positive prefix, the
  323. result of the operation will be inserted into the buffer after the
  324. form that was just sent.  If lisp-wait-p is t, then EMACS will display
  325. the result of the command in the minibuffer or a pop-up window.  If
  326. lisp-wait-p is nil, (the default) the send is done asynchronously and
  327. the results will be brought up only if there is more than one line or
  328. there is an error.  In this case, you will be given the option of
  329. ignoring the error, keeping it in another buffer or keeping it and
  330. aborting all pending sends.  If there is not a command already running
  331. in the inferior LISP, you can preserve the break loop.  If called with
  332. a negative prefix, the sense of lisp-wait-p will be inverted for the
  333. next command.  The and-go versions will perform the operation and then
  334. immediately switch to the ILISP buffer where you will see the results
  335. of executing your form.  If eval-defun-and-go-lisp
  336. \(\\[eval-defun-and-go-lisp]) or compile-defun-and-go-lisp
  337. \(\\[compile-defun-and-go-lisp]) is called with a prefix, a call for
  338. the form will be inserted as well.
  339.  
  340. When an eval is done of a single form matching ilisp-defvar-regexp,
  341. the corresponding symbol will be unbound and the value assigned again.
  342.  
  343. When compile-defun-lisp \(\\[compile-defun-lisp]) is called in an
  344. inferior LISP buffer with no current form, the last form typed to the
  345. top-level will be compiled.
  346.  
  347. The following commands all deal with finding things in source code.
  348. The first time that one of these commands is used, there may be some
  349. delay while the source module is loaded.  When searching files, the
  350. first applicable rule is used: 1) try the inferior LISP, 2) try a tags
  351. file if defined, 3) try all buffers in one of lisp-source-modes or all
  352. files defined using lisp-directory.
  353.  
  354. lisp-directory \(\\[lisp-directory]) defines a set of files to be
  355. searched by the source code commands.  It prompts for a directory and
  356. sets the source files to be those in the directory that match entries
  357. in auto-mode-alist for modes in lisp-source-modes.  With a positive
  358. prefix, the files are appended.  With a negative prefix, all current
  359. buffers that are in one of lisp-source-modes will be searched.  This
  360. is also what happens by default.  Using this command stops using a
  361. tags file.
  362.  
  363. edit-definitions-lisp \(\\[edit-definitions-lisp]) will find a
  364. particular type of definition for a symbol.  It tries to use the rules
  365. described above.  The files to be searched are listed in the buffer
  366. \*Edit-Definitions*.  If lisp-edit-files is nil, no search will be
  367. done if not found through the inferior LISP.  The variable
  368. ilisp-locator contains a function that when given the name and type
  369. should be able to find the appropriate definition in the file.  There
  370. is often a flag to cause your LISP to record source files that you
  371. will need to set in the initialization file for your LISP.  The
  372. variable is \*record-source-files* in both allegro and lucid.  Once a
  373. definition has been found, next-definition-lisp
  374. \(\\[next-definition-lisp]) will find the next definition.  \(Or the
  375. previous definition with a prefix.)
  376.  
  377. edit-callers-lisp \(\\[edit-callers-lisp]) will generate a list of all
  378. of the callers of a function in the current inferior LISP and edit the
  379. first caller using edit-definitions-lisp.  Each successive call to
  380. next-caller-lisp \(\\[next-caller-lisp]) will edit the next caller.
  381. \(Or the previous caller with a prefix.)  The list is stored in the
  382. buffer \*All-Callers*.  You can also look at the callers by doing
  383. who-calls-lisp \(\\[who-calls-lisp]).
  384.  
  385. search-lisp \(\\[search-lisp]) will search the current tags files,
  386. lisp directory files or buffers in one of lisp-source-modes for a
  387. string or a regular expression when called with a prefix.
  388. \(\\[next-definition-lisp]) will find the next definition.  \(Or the
  389. previous definition with a prefix.)
  390.  
  391. replace-lisp \(\\[replace-lisp]) will replace a string (or a regexp
  392. with a prefix) in the current tags files, lisp directory files or
  393. buffers in one of lisp-source-modes.
  394.  
  395. The following commands all deal with making a number of changes all at
  396. once.  The first time one of these commands is used, there may be some
  397. delay as the module is loaded.  The eval/compile versions of these
  398. commands are always executed asynchronously.
  399.  
  400. mark-change-lisp \(\\[mark-change-lisp]) marks the current defun as
  401. being changed.  A prefix causes it to be unmarked.  clear-changes-lisp
  402. \(\\[clear-changes-lisp]) will clear all of the changes.
  403. list-changes-lisp \(\\[list-changes-lisp]) will show the forms
  404. currently marked. 
  405.  
  406. eval-changes-lisp \(\\[eval-changes-lisp]), or compile-changes-lisp
  407. \(\\[compile-changes-lisp]) will evaluate or compile these changes as
  408. appropriate.  If called with a positive prefix, the changes will be
  409. kept.  If there is an error, the process will stop and show the error
  410. and all remaining changes will remain in the list.  All of the results
  411. will be kept in the buffer *Last-Changes*.
  412.  
  413. File commands in lisp-source-mode buffers keep track of the last used
  414. directory and file.  If the point is on a string, that will be the
  415. default if the file exists.  If the buffer is one of
  416. lisp-source-modes, the buffer file will be the default.  Otherwise,
  417. the last file used in a lisp-source-mode will be used.
  418.  
  419. find-file-lisp \(\\[find-file-lisp]) will find a file.  If it is in a
  420. string, that will be used as the default if it matches an existing
  421. file.  Symbolic links are expanded so that different references to the
  422. same file will end up with the same buffer.
  423.  
  424. load-file-lisp \(\\[load-file-lisp]) will load a file into the inferior
  425. LISP.  You will be given the opportunity to save the buffer if it has
  426. changed and to compile the file if the compiled version is older than
  427. the current version.
  428.  
  429. compile-file-lisp \(\\[compile-file-lisp]) will compile a file in the
  430. current inferior LISP.")
  431.